package com.itheima.a08threadmethod5;

public class ThreadDemo {
    public static void main(String[] args) {
        /*
        public final void join()    插入线程/插队线程
         */

        MyThread myThread = new MyThread();
        myThread.setName("土豆");

        myThread.start();

        //表示把myThread这个线程，插入到当前线程之前。
        //myThread: 土豆
        //当前线程 main
        try {
            myThread.join();
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }


        // 执行在main线程当中的
        for(int i = 1; i <= 10; i++){
            System.out.println(Thread.currentThread().getName()+"@"+i);
        }
    }
}
